package com.hit.widget;

import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hit.HitIFragment;
import com.hit.util.HitLog;

public abstract class HitWaitingDialog extends DialogFragment implements
		HitIFragment {

	protected View mView;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mView = inflater.inflate(getViewResource(), null, false);
		setUpView();
		loadDataToView();
		return mView;
	}

	@SuppressWarnings("unchecked")
	protected <T extends View> T findViewById(int id) {
		return (T) mView.findViewById(id);
	}

	public void show(FragmentManager fm) {

		HitLog.out("hit tag dialog: "+this.getClass().getSimpleName());
		show(fm, this.getClass().getSimpleName());
	}
}
